<?php
$db = new PDO('mysql:host=localhost;dbname=db3','root','12qwas');
$ps=$db->query('select count(*) from students');
echo "记录个数为：{$ps->fetchColumn()}\n";